<template>
   <div>
     <el-pagination class="yx_page"
                    background
                    @current-change="handle_current_change"
                    @size-change="handle_size_change"
                    :page-sizes="page_sizes"
                    :page-size="page_size"
                    layout="prev, pager, next,sizes, total"
                    :total="total_count">
     </el-pagination>
   </div>
</template>

<script>
  export default {
     name:'Pagination',
     props:[ 'getList','total_count'],
     data(){
        return {
            page_sizes:this.$store.state.page_sizes,
            current_page:1,
            page_size:this.$store.state.default_page_size
        }
     },
     methods:{
       handle_size_change(page_size){
          this.current_page=1;
          this.page_size=page_size;
          this.getList(1,page_size);
       },
       handle_current_change(current_page){
          this.current_page=current_page;
          this.getList(current_page,this.page_size);
       }
     }
  }
</script>

<style>
</style>
